FROM php:fpm

env DEV_DEPS \
      libfreetype6-dev \
      libjpeg62-turbo-dev \
      libpng-dev \
      libwebp-dev \
      libxpm-dev \
      libzip-dev

RUN echo 'date.timezone = Asia/Shanghai' > /usr/local/etc/php/conf.d/timezone.ini \
  && apt-get update \
  && apt-get install -y --no-install-recommends \
      libfreetype6 \
      libjpeg62-turbo \
      libpng16-16 \
      libwebp6 \
      libxpm4 \
      libzip4 \
      $DEV_DEPS \
  && docker-php-ext-install \
      bcmath \
      calendar \
      exif \
      gd \
      pdo_mysql \
      zip \
  && pecl install \
      apcu \
      redis \
  && docker-php-ext-enable \
      apcu \
      redis \
  && apt-get purge -y $DEV_DEPS \
  && rm -rf /var/lib/apt/lists/*
